﻿using System;
using System.Collections.Generic;
using System.Data.Objects.DataClasses;
using System.Linq;
using System.Web;

namespace CDOP.Model
{
    public partial class CDOPEntities
    {
        public object UpdateEntityObject(EntityObject objectDetached)
        {
            if (objectDetached.EntityState == System.Data.EntityState.Modified)
            {
                object original = null;
                if (base.TryGetObjectByKey(objectDetached.EntityKey, out original))
                    return base.ApplyCurrentValues(objectDetached.EntityKey.EntitySetName, objectDetached);
                else
                    //throw new ObjectNotFoundException();
                    return null;
                }
            return null;
        }
    }
}